package com.wthink.hzgj.msgList.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.wthink.hzgj.data.domain.NoticeMsg
import com.wthink.hzgj.util.PreferencesUtils


class MsgLisgItemViewmodel : ViewModel(){

    //val noticeMsgList = MutableLiveData(emptyList<NoticeMsg>())
    val noticeMsgList = MutableLiveData(emptyList<NoticeMsg>())
    val noticeMsgArray = ArrayList<NoticeMsg>()

    fun start(){
       // var stringToList1  = arrayListOf<String>("哈哈哈0","哈哈哈1","哈哈哈2","哈哈哈3","哈哈哈4","哈哈哈5","哈哈哈6","哈哈哈7")
        val stringToList = PreferencesUtils.stringToList()
        for (value in stringToList) {
            noticeMsgArray.add(NoticeMsg(value.msg,value.time,value.index,value.isLastMsg,false))
        }
        noticeMsgList.postValue(noticeMsgArray)
    }
}

